﻿<Application x:Class="WpfEncryption.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:WpfEncryption.Converter"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <local:MD5Converter x:Key="MD5Converter" />
        <local:SHA1Converter x:Key="SHA1Converter" />
        <local:SHA256Converter x:Key="SHA256Converter" />
        <local:SHA384Converter x:Key="SHA384Converter" />
        <local:EncodeConverter x:Key="EncodeConverter" />
        <local:CRC32Converter x:Key="CRC32Converter" />
        <local:CheckedConverter x:Key="CheckedConverter" />
        <local:VisiableConverter x:Key="VisiableConverter" />
        <local:MD4Converter x:Key="MD4Converter" />
        <local:NTLMConverter x:Key="NTLMConverter" />
        <local:VisiableButonConverter x:Key="VisiableButonConverter" />
        <local:TextFileConverter x:Key="TextFileConverter" />
        <local:FileSizeConverter x:Key="FileSizeConverter" />
        <local:DropTextConverter x:Key="DropTextConverter" />

        <!--Custome template button -->
        <Style x:Key="MyFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Control}">
                        <Grid Margin="3 2">
                            <Rectangle Name="r1" StrokeThickness="1" Stroke="Black" StrokeDashArray="2 2"/>
                            <Border Name="border" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}"  CornerRadius="2" BorderThickness="1" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>


        <Style x:Key="ShadowStyle">
            <Setter Property="Control.Foreground" Value="LightGray" />
        </Style>

        <Style x:Key="InformButton" TargetType="Button">
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="Margin" Value="2"/>
            <Setter Property="FontFamily" Value="Verdana"/>
            <Setter Property="FontSize" Value="11px"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="FocusVisualStyle" Value="{StaticResource MyFocusVisual}" />
            <Setter Property="Background" >
                <Setter.Value>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" >
                        <GradientStop Color="#FFFFD190" Offset="0.2"/>
                        <GradientStop Color="Orange" Offset="0.85"/>
                        <GradientStop Color="#FFFFD190" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Name="border" 
				BorderThickness="1"
				Padding="4,2" 
				BorderBrush="DarkGray" 
				CornerRadius="3" 
				Background="{TemplateBinding Background}">
                            <Grid >
                                <ContentPresenter HorizontalAlignment="Center" 
	                           VerticalAlignment="Center" Name="contentShadow" 
					Style="{StaticResource ShadowStyle}">
                                    <ContentPresenter.RenderTransform>
                                        <TranslateTransform X="1.0" Y="1.0" />
                                    </ContentPresenter.RenderTransform>
                                </ContentPresenter>
                                <ContentPresenter HorizontalAlignment="Center" 
                            VerticalAlignment="Center" Name="content"/>
                            </Grid>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="border" Property="BorderBrush" Value="#FF4788c8" />
                                <Setter Property="Foreground" Value="#FF4788c8" />
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter Property="Background" >
                                    <Setter.Value>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" >
                                            <GradientStop Color="#FFFFD190" Offset="0.35"/>
                                            <GradientStop Color="Orange" Offset="0.95"/>
                                            <GradientStop Color="#FFFFD190" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                                <Setter TargetName="content" Property="RenderTransform" >
                                    <Setter.Value>
                                        <TranslateTransform Y="1.0" />
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsDefaulted" Value="True">
                                <Setter TargetName="border" Property="BorderBrush" Value="#FF282828" />
                            </Trigger>
                            <Trigger Property="IsFocused" Value="True">
                                <Setter TargetName="border" Property="BorderBrush" Value="#FF282828" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter TargetName="border" Property="Opacity" Value="0.7" />
                                <Setter Property="Foreground" Value="Gray" />
                            </Trigger>

                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Application.Resources>
</Application>
